package com.zeekr.myroomtest.room

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey

@Entity(tableName = "item")
data class Item(
    //主键 自增
    @PrimaryKey(autoGenerate = true)
    val id: Int = 0,
    //ColumnInfo : 可以设置自定义的tableName
    @ColumnInfo(name = "name")
    val itemName: String,
    @ColumnInfo(name = "price")
    val itemPrice: Double,
    @ColumnInfo(name = "quantity")
    val quantityInStock: Int
) {
    override fun toString(): String {
        return "Item(id=$id, itemName='$itemName', itemPrice=$itemPrice, quantityInStock=$quantityInStock)"
    }
}